﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

namespace Chat.Client
{
    /// <summary>
    /// The very first command sent by the chat client to the server, immediately
    /// after connection establishment.
    /// </summary>
    [Serializable]
    public class LoginCmd : ClientCmd
    {
        /// <summary>
        /// The default color that the client wants his messages to be displayed in
        /// at the other clients.
        /// </summary>
        private Color TextColor { set; get; }

        public LoginCmd(LoginData loginData) :
            base(loginData.User)
        {
            TextColor = loginData.TextColor;
        }

        /// <summary>
        /// Gets the login data used by the chat for clients identification
        /// against the chat server.
        /// </summary>
        public LoginData LoginData
        {
            get
            {
                return new LoginData(Sender, TextColor);
            }
        }
    }
}
